<div class="row"">
<div class="col-md-2">
    <?php include(dirname(dirname(__FILE__)).'/sidebar.phtml');?>
</div>
<div class="col-md-10">
  <form class="form-inline task" action="/manage/stat/elchee/" method = "GET">
    <div class="form-group">
      <label class="control-label">UID</label>
      <input class="form-control" name="uid" type="text" placeholder="UID" value="<?php if(!empty($params['uid'])): echo $params['uid']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">日期</label>
      <select class="form-control" name="date" style="width: 80px;">
        <option value="" <?php if(empty($params['date']) || $params['date']==''){ echo 'selected';} ?>>昨天</option>
        <?php foreach($date as $val){ ?>
          <option value="<?php echo $val?>" <?php if(!empty($params['date']) && $params['date']== $val){ echo 'selected';} ?>><?php echo $val?></option>
        <?php } ?>
      </select>
    </div>
    <div class="form-group">
      <label class="control-label">排序(倒序)</label>
      <select class="form-control" name="sort" style="width: 60px;">
        <option value="" <?php if(empty($params['sort']) || $params['sort']==''){ echo 'selected';} ?>>徒弟数</option>
        <option value="diff" <?php if(!empty($params['sort']) && $params['sort']=='diff'){ echo 'selected';} ?>>收徒排名变化</option>
      </select>
    </div>
    <button type="submit" class="btn btn-default btn-gap">搜索</button>
  </form>
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      Top500大使列表
    </div>
    <div class="panel-body">
      <table class="table table-bordered table-striped">
        <thead>
          <tr>
            <th scope="col">UID</th>
            <th scope="col">手机号</th>
            <th scope="col">累计收入</th>
            <th scope="col">邀请人数</th>
            <th scope="col">注册时间</th>
            <th scope="col">IP</th>
            <th scope="col">排名变化</th>
            <th scope="col">当日排名</th>
            <th scope="col">日期</th>
          </tr>
        </thead>
        <tbody>
        <?php foreach ($rowsets as $row):?>
          <tr>
            <td><a href="/manage/user/index/?uid=<?php echo $row['uid']?>"><?php echo $row['uid']?></a></td>
            <td><?php echo $row['mobile']?></td>
            <td><?php echo $row['invite_add_up']?></td>
            <td><?php echo $row['invite_num']?></td>
            <td><?php echo date("Y-m-d H:i:s",$row['regtime'])?></td>
            <td><?php echo $row['remote_ip']?></td>
            <td><?php if($row['diff']>0){ ?><i style="color: red" class="glyphicon glyphicon-arrow-up"></i>
                <?php }elseif($row['diff']==0){?><i class="glyphicon glyphicon-minus"></i>
                <?php }else{ ?><i style="color: green" class="glyphicon glyphicon-arrow-down"></i>
                <?php } echo abs($row['diff'])?>
            </td>
            <td><?php echo $row['top']?></td>
            <td><?php echo $row['date']?></td>
          </tr>
        <?php endforeach;?>
        </tbody>
      </table>
      <?php $pager->render();?>
      <a href="/manage/stat/elcheeOutput/?<?php echo http_build_query($params) ?>" class="btn btn-success">导出Excel文件</a>
    </div>
  </div>
</div>
